Answer:

' Draw three circles in the same row
SCREEN 12
COLOR 4
'
LET ROW = 200
LET RADIUS = 20
'
LET COLUMN = 50
CIRCLE  (COLUMN, ROW),RADIUS
'
LET COLUMN = 100
CIRCLE  (COLUMN, ROW),RADIUS
'
LET COLUMN = 150
CIRCLE  (COLUMN, ROW),RADIUS
'
END
A simple change in one statement is all that it takes.

INPUT with Graphics

The above program can easily be modified by changing the value that the LET statement puts in ROW. An INPUT statement is a way for the user of a program to enter a value while the program is running. Here is a modified program that asks the user to type in a value for ROW:

' Draw three circles in the same row
' Ask the user for the row to use

PRINT "What row do you want"     'statement 1
INPUT ROW                        'statement 2
'
SCREEN 12                        'statement 3
COLOR 4                          'statement 4
LET RADIUS = 20                  'statement 5
'
LET COLUMN = 50                  'statement 6
CIRCLE  (COLUMN, ROW), RADIUS    'statement 7
'
LET COLUMN = 100                 'statement 8
CIRCLE  (COLUMN, ROW), RADIUS    'statement 9
'
LET COLUMN = 150                 'statement 10
CIRCLE  (COLUMN, ROW), RADIUS    'statement 11
'
END                              'statement 12
(If you type this program in and run it, you don't have to type in the comments "statement 1" and so on.) This program is more complicated than most you have seen. Statements execute (are done) one-by-one starting with the first. Here is what it does, step by step:

  1. The PRINT statement prints "What row do you want" on the ordinary screen.
  2. The INPUT statement puts a "? " on the ordinary screen and waits for the user to type a number. Say that the user typed 99. The statement will put 99 in the part of memory called ROW.
  3. The SCREEN statement (statement 3) sends electronic signals to the graphics hardware so that graphics screen 12 will work.
  4. The COLOR statement selects color 4 (red) for the pen.
  5. The LET statement puts a 20 in the variable (part of memory) called RADIUS.

  6. The next LET statement (statement 6) puts 50 in the variable COLUMN.
  7. The CIRCLE statement has no numbers in it—so it must look into the variables COLUMN, ROW, and RADIUS for the numbers it needs. It finds 50, 99, and 20; and so draws a red circle at (x=50, y=99) with radius 20.
  8. The next LET statement (statement 8) puts 100 in the variable COLUMN (replacing what was there before.)
  9. The next CIRCLE statement must look into the variables COLUMN, ROW, and RADIUS for the numbers it needs. It finds 100, 99, and 20; and so draws a red circle at (x=100, y=99) with radius 20.
  10. The next LET statement (statement 10 ) puts 150 in the variable COLUMN (replacing what was there before.)
  11. The final CIRCLE statement must look into the variables COLUMN, ROW, and RADIUS for the numbers it needs. It finds 150, 99, and 20; and so draws a red circle at (x=150, y=99) with radius 20.
  12. The final END statement stops the program.

QUESTION 22:

Of course you have several INPUT statements preceding the SCREEN to get several numbers from the user.

How could you modify the above program so that it also asked the user for the color number of the circles?